package zjt.demo2;

public class Demo1 {
        int a = 1;
        static int b = 2;
        final int c = 3;
        public void method1(){
            System.out.println("成员方法");
        }
        public static void method2(){
            System.out.println("成员静态方法");
    }
    {
        System.out.println("构造代码块");
    }
    static {
            System.out.println("静态代码块");
        }
    public Demo1(){
        System.out.println("构造方法");
    }
    private class Inner{
        int a = 11;
        public void method3(){
            System.out.println("内部类普通方法");
            System.out.println(Demo1.this.a);
        }
    }
    private static class Inner2{
        int a = 111;
        static int b = 222;
        public void method4(){
            System.out.println("静态内部类普通方法");
        }
    }

    public static void main(String[] args) {
        Demo1 demo1 = new Demo1();
        System.out.println(demo1.a);
        System.out.println(Demo1.b);

        Inner inner = demo1.new Inner();
        System.out.println(inner.a);
        inner.method3();

        Inner2 inner2 = new Inner2();
        System.out.println(inner2.a);
        System.out.println(Inner2.b);
        Father father = new son();

    }

}
class Father{
    void have(){

    }
}
class son extends Father{
    void have(){

    }
}